package com.typy.www.tpay.ui.itemview;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.typy.www.tpay.R;
import com.typy.www.tpay.bean.bean.HomeBtnBean;

import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.BlurTransformation;

/**
 * Created by 13799 on 2018/6/16.
 */

public class MineHomeItemView {
    private View mView;
    Context mContext;
    ViewHolder holder;
    private int type;

    public View getmView() {
        return mView;
    }

    public MineHomeItemView(Context context, int type) {
        mContext = context;
        this.type = type;
        if (type == 0)
            mView = LayoutInflater.from(context).inflate(R.layout.item_minehome, null);
//        else if (type == 3)
//            mView = LayoutInflater.from(context).inflate(R.layout.item_minehome2, null);
        else
            mView = LayoutInflater.from(context).inflate(R.layout.item_four, null);
        holder = new ViewHolder(mView);
    }

    public void bind(HomeBtnBean bean) {
        holder.tvTitle.setText(bean.getBtnName());
        Glide.with(mContext).load(bean.getImaResId()).into(holder.imgIcon);
    }


    static class ViewHolder {
        @BindView(R.id.img_bg)
        ImageView imgBg;
        @BindView(R.id.img_icon)
        ImageView imgIcon;
        @BindView(R.id.tv_title)
        TextView tvTitle;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
